# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Radoslaw Mejer <radmen@radmen.info>
pkgname=silicon
pkgver=0.5.1
pkgrel=1
pkgdesc="Create beautiful images of your code"
depends=('fontconfig' 'freetype2' 'xclip')
makedepends=('rust' 'cargo' 'glibc' 'llvm-libs' 'gcc-libs' 'clang' 'python')
arch=('loong64' 'x86_64')
license=('MIT')
url="https://github.com/Aloxaf/silicon"
source=("$pkgname-$pkgver.tar.gz::https://github.com/Aloxaf/silicon/archive/v$pkgver.tar.gz")
options=('!lto')
sha256sums=('784a6f99001f2000422b676e637fe83a5dc27f5fc55ad33e227c882ce20e6439')

build() {
    cd "$srcdir/silicon-$pkgver"
    cargo build --release --locked
}

check() {
    cd "$srcdir/silicon-$pkgver"
    cargo check --locked
}

package() {
    cd "$srcdir/silicon-$pkgver"
    install -Dm755 "target/release/silicon" "$pkgdir/usr/bin/$pkgname"
    install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
